package com.study.lihan.springmvc.controller;

import com.study.lihan.springmvc.service.ThreadTestServiceImpl;
import com.study.lihan.springmvc.service.TxService;
import com.study.lihan.springmvc.service.TxService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class TestController {
    @Autowired
    private ThreadTestServiceImpl threadTestService;

    @Autowired
    private TxService txService;
    @Autowired
    private TxService2 txService2;
    @GetMapping("/thread")
    public String thread(){
        threadTestService.threadTestTransactional();
        return "ok";
    }

    @GetMapping("/tx")
    public String tx(){
        txService.threadTestTransactional();
        return "ok";
    }
    @GetMapping("/tx2")
    public String tx2(){
        txService2.threadTestTransactional();
        return "ok";
    }

    @GetMapping("/test")
    public String test(){
        txService2.yuner();
        return "ok";
    }


}